package com.demo.service.impl;

import com.demo.mapper.AccountMapper;
import com.demo.pojo.Account;
import com.demo.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public List<Account> selectAll() {
        return accountMapper.selectAll();
    }

    @Override
    public Account getById(int id) {
        return accountMapper.getById(id);
    }

    @Override
    public Boolean delete(int id) {
        return accountMapper.delete(id)>0;
    }

    @Override
    public Boolean update(int id) {
        return accountMapper.update(id)>0;
    }

    @Override
    public Boolean insert(Account account) {
        return accountMapper.insert(account)>0;
    }
}
